#include <REGX52.H>
#include "Timer.h"
void Timer0_Init() // 1毫秒@11.0592MHz
{
    TMOD &= 0xF0;
    TMOD |= 0x01;
    TF0 = 0;
    TR0 = 1;
    TL0 = 0x66; 
    TH0 = 0xFC;
    ET0=1;  //开启中断
    EA=1;
    PT0=0;
}

static unsigned int T0Count;
void Timer0_Rountine()  interrupt 1
{
    TL0 = 0x66; 
    TH0 = 0xFC;
    T0Count++;
}

void Delay_Timer0_ms(unsigned int ms)
{
    unsigned int i;
    T0Count = 0;
    for(i=0;i<ms;i++)
    {
        while(T0Count < (i+1));
    }
}